Ext.define('DragonApp.view.ban.Window', {
    extend: 'Ext.window.Window',
    alias: 'widget.ban_window',
    config: {
        url: undefined,
        records: undefined
    },
    layout: 'center',

    closable: true,
    modal: true,

    items: [{
        xtype: 'form',
        padding: 10,
        modelValidation: true,
        reference: 'ban_form',
        layout: {
            type: 'fit',
            align: 'stretch'
        },
        items: [{
            xtype: 'fieldset',
            width: 350,
            height: 160,
            title: '封禁信息',
            layout: 'anchor',
            padding: '10 10 10 10',
            defaults: {
                afterLabelTextTpl: DragonApp.util.String.required,
                anchor: '100%',
                xtype: 'textfield',
                msgTarget: 'side',
                labelWidth: 70
            },
            items: [{
                    afterLabelTextTpl: DragonApp.util.String.required,
                    labelWidth: 80,
                    fieldLabel: '截止时间',
                    xtype: 'datetimefield',
                    format: 'Y-m-d H:i:s',
					minValue: new Date(),
                    name: 'deadline',
                    margin: '0 0 10 0',
                    allowBlank: false,
                    emptyText: '请选择'
                },
                {
                    xtype: 'textarea',
                    fieldLabel: '原因',
                    name: 'reason',
                    width: 300,
                    height: 80,
                    allowBlank: false,
                    emptyText: '请输入封禁原因',
                    maxLength: 50,
                    maxLengthText: '最大字符数为 {0} 个字符'
                },
                {
                    xtype: 'hiddenfield',
                    fieldLabel: '封禁用户',
                    name: 'id'
                }
            ]
        }]
    }],
    dockedItems: [{
        xtype: 'toolbar',
        dock: 'bottom',
        ui: 'footer',
        layout: {
            pack: 'end',
            type: 'hbox'
        },
        items: [{
            xtype: 'button',
            text: '取消',
            iconCls: 'x-fa fa-times',
            handler: 'onCancel'
        }, {
            xtype: 'button',
            text: '保存',
            iconCls: 'x-fa fa-check',
            handler: 'onSave'
        }]
    }]
});